package com.shiminghui.test5;

public class GirlFriendTest {
    public static void main(String[] args) {

        GirlFriend girlFriend1 = new GirlFriend("a",19,"nv","lanqiu");
        GirlFriend girlFriend2 = new GirlFriend("a",56,"nv","lanqiu");
        GirlFriend girlFriend3 = new GirlFriend("a",34,"nv","lanqiu");
        GirlFriend girlFriend4 = new GirlFriend("a",25,"nv","lanqiu");

        GirlFriend[] arr = new GirlFriend[4];
        arr[0]=girlFriend1;
        arr[1]=girlFriend2;
        arr[2]=girlFriend3;
        arr[3]=girlFriend4;

        int sum =0;
        for (int i = 0; i < arr.length; i++) {
            sum+=arr[i].getAge();
        }
        int avg = sum/arr.length;
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i].getAge()<avg){
                count++;
            }
        }
        System.out.println(count);
    }
}
